In recent years, Java that does not depend on platforms, such as specific hardware and an OS, and which can operate in various devices, has become prevalent, from large servers to cellular phones. Java is an object-oriented programming language similar to C++ developed by Sun Microsystems, Inc., and “Java” is a registered trademark of Sun Microsystems, Inc. in the United States and other countries.
In Java, when being compiled, a source code is translated into an intermediate language called a byte-code that is independent of platforms. The byte-code that is interpreted to a native code inherent in the microprocessor using software called a Java virtual machine (VM). By preparing the Java virtual machine corresponding to a platform, the Java virtual machine accommodates differences in platforms.
Execution of the byte-code in the Java virtual machine is a low speed process because the byte-code is interpreted and processed one by one by the interpreter method. Because of this fact, in order to reduce the overhead associated with an interpreter processing loop, translation of the byte-code into a native code is executed using hardware for a frequently used byte-code, thus achieving high speed processing. For example, the below-listed patent document 1 discloses hardware for translating a byte-code into a native code of the microprocessor. Java-based systems are configured to process rarely used byte-codes using a software Java virtual machine.
In this context, there is a CLDC (Connected limited device configuration) as one of the assumed execution environments (configurations) defined in J2ME, which is a Java language specification for built in devices. CLDC is directed at small portable apparatuses and cellular phones, and its supporting virtual machine is KVM.
In CLDC1.1, the floating-point byte-code was added to the object byte-codes. In order to execute a floating-point byte-code with hardware, the use of a FPU becomes necessary. The below-listed patent document 2 discloses hardware that uses a FPU (Floating-point processing unit) to translate a floating-point byte-code into an FPU instruction.
[Patent Document 1]
U.S. Pat. No. 6,332,215 specification    [Patent document 2]
British Patent Application Laid-open No. 2376099 specification
In this specification, hardware for translating a stack-based byte-code into a register-based native code will be called a byte-code accelerator. In this byte-code accelerator, the upper element of an operand stack maintained in each frame of Java can be copied to a part of the general-purpose register of the CPU. By reusing the value of the register, the stack-based load and store instructions can be reduced. In this case, for example, when the FPU accepts an instruction code from the CPU and operates as a coprocessor of the CPU, the byte-code accelerator feeds an FPU instruction to the CPU for the floating-point byte-code, and the CPU makes the FPU conduct an operation. If the arithmetic register of the FPU is made a target of the stack, as with the general-purpose register of a CPU, it is necessary for the byte-code accelerator to consider the consistency of data between the general-purpose register of the CPU and the arithmetic register of the FPU, which is likely to complicate the data management of the stack.
Moreover, data that cannot be handled by the FPU exists among the floating-point data. For example, such data is data of an operation on a NaN (Not-a-Number) as input etc. In the patent document 2, in the case of the data that the VFP (FPU) cannot handle, the VFP generates a VFP exception, and the CPU emulates a VFP operation in a VFP exception handler. Then, the CPU determines that an instruction having caused a VFP (FPU) exception is actually a VFP instruction by checking the status register of VPU. There is a case where the floating-point which has having caused the occurrence of an exception cannot be grasped correctly because of imprecise exception signaling. This requires provision of an exception handler that can cope with both a case where detection of the floating-point operation is correct and a case where the detection is inaccurate.